package common.utils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;
import java.util.UUID;

/**
 * Created by luozongsheng on 20/12/2016.
 */
public class CommomRandom {

    public static String buildRandomStr(int randomLength) {
        Random random = new Random();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddhhmmssSSS");
        String str = sdf.format(new Date());
        for (int i = 0; i < randomLength; i++) {
            str += random.nextInt(10);
        }
        return str;
    }

    public static String uuId() {
        String uuid = UUID.randomUUID().toString().replaceAll("-", "");
        return uuid;
    }

}
